/**
 * Copyright JS Foundation and other contributors, http://js.foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/


.red-ui-popover {
    display: none;
    position: absolute;
    width: auto;
    padding: 2px;
    height: auto;
    background: var(--red-ui-popover-border);
    color: var(--red-ui-popover-color);
    border-radius: 4px;
    z-index: 1000;
    font-family: var(--red-ui-primary-font);
    font-size: 14px;
    line-height: 1.4em;
    @include component-shadow;
    border-color: var(--red-ui-popover-border);
}
.red-ui-popover-content {
    padding: 8px;
    border-radius: 2px;
    background: var(--red-ui-popover-background);
    overflow-wrap: anywhere;
}
.red-ui-popover:after, .red-ui-popover:before {
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.red-ui-popover.red-ui-popover-right:after, .red-ui-popover.red-ui-popover-right:before {
    top: 50%;
    right: 100%;
}
.red-ui-popover.red-ui-popover-left:after, .red-ui-popover.red-ui-popover-left:before {
    top: 50%;
    left: 100%;
}

.red-ui-popover.red-ui-popover-bottom:after, .red-ui-popover.red-ui-popover-bottom:before {
    bottom: 100%;
    left: 50%;
}

.red-ui-popover.red-ui-popover-top:after, .red-ui-popover.red-ui-popover-top:before {
    top: 100%;
    left: 50%;
}

.red-ui-popover.red-ui-popover-right:after {
    border-color: transparent;
    border-right-color: var(--red-ui-popover-border);
    border-width: 10px;
    margin-top: -10px;
}
.red-ui-popover.red-ui-popover-right:before {
    border-color: transparent;
    border-right-color: var(--red-ui-popover-border);
    border-width: 11px;
    margin-top: -11px;
}

.red-ui-popover.red-ui-popover-left:after {
    border-color: transparent;
    border-left-color: var(--red-ui-popover-border);
    border-width: 10px;
    margin-top: -10px;
}
.red-ui-popover.red-ui-popover-left:before {
    border-color: transparent;
    border-left-color: var(--red-ui-popover-border);
    border-width: 11px;
    margin-top: -11px;
}


.red-ui-popover.red-ui-popover-bottom:after {
    border-color: transparent;
    border-bottom-color: var(--red-ui-popover-border);
    border-width: 10px;
    margin-left: -10px;
}
.red-ui-popover.red-ui-popover-bottom:before {
    border-color: transparent;
    border-bottom-color: var(--red-ui-popover-border);
    border-width: 11px;
    margin-left: -11px;
}

.red-ui-popover.red-ui-popover-top:after {
    border-color: transparent;
    border-top-color: var(--red-ui-popover-border);
    border-width: 10px;
    margin-left: -10px;
}
.red-ui-popover.red-ui-popover-top:before {
    border-color: transparent;
    border-top-color: var(--red-ui-popover-border);
    border-width: 11px;
    margin-left: -11px;
}



.red-ui-popover-size-small {
    font-size: 12px;
    line-height: 1.8em;
    .red-ui-popover-content {
        padding: 1px 4px;
    }
    &.red-ui-popover-right:after, &.red-ui-popover-left:after {
        border-width: 7px;
        margin-top: -7px;
    }
    &.red-ui-popover-right:before, &.red-ui-popover-left:before {
        border-width: 8px;
        margin-top: -8px;
    }

    &.red-ui-popover-bottom:after, &.red-ui-popover-top:after {
        border-width: 7px;
        margin-left: -7px;
    }
    &.red-ui-popover-bottom:before, &.red-ui-popover-top:before {
        border-width: 8px;
        margin-left: -8px;
    }

}

.red-ui-popover-key {
    font-size: 11px;
    font-family: var(--red-ui-monospace-font);
    margin-left: 3px;
    border: 1px solid var(--red-ui-popover-color);
    border-radius:3px;
    padding: 1px 2px;
}
.red-ui-popover {
    a {
        text-decoration: none;
        color: var(--red-ui-popover-color) !important;
    }
    a:hover,
    a:focus {
        text-decoration: none;
        color: var(--red-ui-popover-color) !important;
    }
    a:focus {
        outline: 1px solid var(--red-ui-form-input-focus-color);
    }
}
.red-ui-popover a.red-ui-button,
.red-ui-popover button.red-ui-button {
    &:not(.primary) {
        border-color: var(--red-ui-popover-button-border-color);
        background: var(--red-ui-popover-background);
        color: var(--red-ui-popover-color) !important;
    }
    &:not(.primary):not(.disabled):not(.ui-button-disabled):hover {
        border-color: var(--red-ui-popover-button-border-color-hover);
    }


    &.primary {
        border-color: var(--red-ui-popover-button-border-color);
    }
    &.primary:not(.disabled):not(.ui-button-disabled):hover {
        border-color: var(--red-ui-popover-button-border-color-hover);
    }
}
.red-ui-popover code {
    border: none;
    background: none;
    color: var(--red-ui-tertiary-text-color);
}


.red-ui-popover-panel {
    @include component-shadow;
    font-family: var(--red-ui-primary-font);
    font-size: var(--red-ui-primary-font-size);
    position: absolute;
    box-sizing: border-box;
    border: 1px solid var(--red-ui-primary-border-color);
    background: var(--red-ui-secondary-background);
    z-index: 2000;
}
